package server;

import java.io.IOException;
import java.net.Socket;

import net.Connection;

public class ServerSideConnection extends Connection {

	protected final Server controller;

	public ServerSideConnection(Server controller, Socket socket)
			throws IOException {
		this.tcpSocket = socket;
		this.controller = controller;
		open();
		ip = socket.getInetAddress().getHostAddress();
		tcpPort = socket.getPort();
		tcpThread = new Thread(this);
		tcpThread.start();
	}

	@Override
	public void intercept(byte[] bytes) {
	}

	@Override
	public void sendUDP(byte[] bytes, int offset, int len) {
		controller.sendUDP(bytes, offset, len, this);
	}

}
